package com.shop.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * 用户
 */
@Data
@TableName("manager")
@ApiModel("Manager对象")
public class Manager implements Serializable {
    @TableId(value = "manager_id",type = IdType.AUTO)
    @ApiModelProperty(value = "管理员id",required = true,example = "0")
    private Integer id;//管理员主键

    @TableField("manager_name")
    @ApiModelProperty("管理员名称")
    private String name;//管理员名称

    @TableField("username")
    @ApiModelProperty("管理员账号")
    private String username;//账号

    @TableField("password")
    @ApiModelProperty("管理员密码")
    private String password;//密码

    @TableField(exist = false)
    @ApiModelProperty("角色集合")
    private Set<Role> roles = new HashSet<Role>(0);//对应角色集合

    @TableField(exist = false)
    @ApiModelProperty("角色id")
    private Integer roleId;//角色id

    @TableField(exist = false)
    @ApiModelProperty("角色名称")
    private String roleName;//角色名称

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
